package com.example.controller;

import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 测试用的Controller
 * @author cjd
 * @date 2024/01/30 20:19
 */
@RestController
public class HelloController {

    /**
     * 注解：@PreAuthorize：控制权限，当前登录用户拥有"system:dept:list"权限才可以访问
     * @return
     */
    @RequestMapping("/hello")
    @PreAuthorize("hasAuthority('system:dept:list')")
    public String hello(){
        return "hello";
    }
}
